package com.hnevc.inherit;

class Animal {
	String name="动物";
	void shout(){
		System.out.println("动物发出叫声");
	}
}
class Dog extends Animal {
	
	String name="tine";
	@Override
	void shout() {
		System.out.println(name+"发出汪汪的叫声");
	}
}

public class Test {
	public static void main(String[] args){
		Dog dog = new Dog();
		dog.shout();
		Animal animal = (Animal)dog;
		
		animal.shout();
	}
}


